All Questions
190 questions
-4votes
0answers
55views
Creating in Linux files in GB or MB range by various random size by read a file [closed]
In Linux in Bash i have this script (thanks to Ed Morton) . $ cat ./tst.sh #!/usr/bin/env bash while read -r idx sfx size; do echo fallocate "file${idx}.${sfx}" "$size" done &...
-2votes
1answer
111views
Creating in Linux files in GB or MB range by various size by read a file [closed]
In Linux with Bash, there is the File numbers_in_one_line. In this file there is only one line with several numbers, all separated by spaces. These numbers are the value in bytes for creating files ...
0votes
1answer
87views
How to create splittet random files and join them with dmsetup
In Linux in Bash, there is a script, a part of the script is this while true ; do echo awk -v x=$(<"$TEMPDIR"size_container_in_byte) -v n=$(<"$TEMPDIR"parts) 'BEGIN{...
-7votes
2answers
94views
How can I pick random items from a list, but some more often than others, in a Bash config file? [closed]
In Linux, using Bash, I have two scripts: script.sh is the main script, and script_config.sh is the configuration for script.sh. In script.sh, I do source script_config.sh to load all the config ...
-3votes
1answer
50views
Rename files, remove the first four signs [duplicate]
There are many files in this format: IMG_20240717_191421.jpg IMG_20240620_165358_BURST001_COVER.jpg IMG_20240624_173513_2.jpg how can they renamed in Linux in Bash to: 20240717_191421.jpg ...
-1votes
1answer
72views
Best tool to convert xlsx to csv
I need to install something that allow me through a script bash or if I can do it without install any external tool it would be great. The thing is I read about csvkit but is a tool of python and i ...
2votes
1answer
167views
select in a script
In Linux in Bash in a Script i use this: #!/bin/bash while true; do while true; do read -r -p 'enter number [4-999]: ' num if [[ $num =~ ^([4-9]|[1-9][0-9]{1,2})$ ]]; then ...
-4votes
2answers
110views
How to write in Linux in Bash in shellscript a part that can do something like this
How to write in Linux in Bash in shellscript a part that can do something like this enter a number must be in a range from 4-999 if not, ask again to enter enterednumber * 5 * randomnumber [1-9] (...
1vote
1answer
110views
add a randomize option in a bash script
in a bash script i do run this: seq 1 $(<howmany.txt) | xargs -I% -n1 -P$(<parallel.txt) mycommand --infile file% --option A --outfile file%.new it works. the values in howmany.txt and parallel....
0votes
1answer
36views
Linux Shell Script replace last shown lines at the screen, not write it under the last once
i run a script from bring formated numbers to the screen : #!/bin/sh while true ; do echo awk -v x=987654321 -v n=8 'BEGIN{srand(); while (--n) {$++NF = int(rand() * x / n); x -= $NF}; $++NF =...
0votes
1answer
60views
join a specific number of files/devices in linear mode together in a linux system
For joining in Linux files/devices in linear mode together i have this script dm-joinlinear.sh from join files/devices in linear mode together in a linux system , thanks telcoM #!/bin/sh usage() { ...
0votes
1answer
70views
Use fallocate with numbers from text file
For testing i create at my Linux-System the file list.txt. In there are numbers like: 4 1 5 2 3 (sometime there are more or less numbers) How do i run these numbers with fallocate? fallocate -l ...
0votes
0answers
53views
SLURM job script - why is the tmp local directory deleted before archiving can occur? How to prevent this?
I wrote a SLURM job script to run a computational chemistry calculation using the CREST program (part of the xtb software package). In the script, I create a temporary directory on the local storage ...
0votes
0answers
90views
keep sudo effective without password after update sudo package itself
I want to write an automation script in Bash that requires frequent use of the sudo command. To avoid entering my password repeatedly after the sudo timeout, I've tried the following: #!/bin/bash sudo ...
0votes
0answers
49views
Why when using the "env -i" command the environment is not really empty? [duplicate]
I am playing with the command env and the option -i of the command. According to the documentation when I use env -i ./myscript.sh I should be getting an empty environment for my script. I gave it a ...